package com.dy.查找.静态表查找;

public class 顺序表查找 {
    public static int seqSearch(int[] nums,int key){
        for(int i=0;i<nums.length;i++){
            if(nums[i]==key){
                return i;
            }
        }
        return -1;
    }

    public static void main(String[] args) {
        int a[]={1,2,3,4,5,6};
        System.out.println( seqSearch(a,3));
    }
}
